/*     */ package com.yss.sofa.cml.text;
/*     */ 
/*     */ import com.yss.sofa.cml.CloneableObject;
/*     */ import com.yss.sofa.cml.SerializableObject;
/*     */ 
/*     */ public class FontKey
/*     */   implements SerializableObject, CloneableObject<FontKey>
/*     */ {
/*     */   private static final long serialVersionUID = 1L;
/*     */   public static final byte PLAIN = 0;
/*     */   public static final byte BOLD = 1;
/*     */   public static final byte ITALIC = 2;
/*     */   public static final byte BOLD_ITALIC = 3;
/*     */   protected String name;
/*     */   protected int size;
/*     */   protected int style;
/*     */   protected boolean underline;
/*     */   protected boolean strikeThrough;
/*     */ 
/*     */   public FontKey(String name, int style, int size)
/*     */   {
/*  16 */     this.name = name;
/*  17 */     this.size = size;
/*  18 */     this.style = style;
/*     */   }
/*     */ 
/*     */   public String getName()
/*     */   {
/*  29 */     return this.name;
/*     */   }
/*     */ 
/*     */   public void setName(String name) {
/*  33 */     this.name = name;
/*     */   }
/*     */ 
/*     */   public int getSize() {
/*  37 */     return this.size;
/*     */   }
/*     */ 
/*     */   public void setSize(int size) {
/*  41 */     this.size = size;
/*     */   }
/*     */ 
/*     */   public int getStyle() {
/*  45 */     return this.style;
/*     */   }
/*     */ 
/*     */   public void setStyle(int style) {
/*  49 */     this.style = style;
/*     */   }
/*     */ 
/*     */   public boolean isBold() {
/*  53 */     return (this.style == 1) || (this.style == 3);
/*     */   }
/*     */ 
/*     */   public boolean isItalic() {
/*  57 */     return (this.style == 2) || (this.style == 3);
/*     */   }
/*     */ 
/*     */   public boolean isUnderline() {
/*  61 */     return this.underline;
/*     */   }
/*     */ 
/*     */   public void setUnderline(boolean underline) {
/*  65 */     this.underline = underline;
/*     */   }
/*     */ 
/*     */   public boolean isStrikeThrough() {
/*  69 */     return this.strikeThrough;
/*     */   }
/*     */ 
/*     */   public void setStrikeThrough(boolean strikeThrough) {
/*  73 */     this.strikeThrough = strikeThrough;
/*     */   }
/*     */ 
/*     */   public int hashCode()
/*     */   {
/*  78 */     int hash = 43;
/*  79 */     hash = hash * 29 + this.name.hashCode();
/*  80 */     hash = hash * 29 + Float.floatToIntBits(this.size);
/*  81 */     hash = hash * 29 + this.style;
/*  82 */     hash = hash * 29 + (this.underline ? 1 : 0);
/*  83 */     hash = hash * 29 + (this.strikeThrough ? 1 : 0);
/*  84 */     return hash;
/*     */   }
/*     */ 
/*     */   public boolean equals(Object obj)
/*     */   {
/*  89 */     if (obj == null) {
/*  90 */       return false;
/*     */     }
/*  92 */     if ((obj instanceof FontKey)) {
/*  93 */       FontKey info = (FontKey)obj;
/*  94 */       return (this.name.equals(info.name)) && (this.size == info.size) && (this.style == info.style) && (this.underline == info.underline) && (this.strikeThrough == info.strikeThrough);
/*     */     }
/*     */ 
/* 100 */     return false;
/*     */   }
/*     */ 
/*     */   public String toString() {
/* 104 */     return "{name: " + this.name + ", size: " + this.size + ", style: " + this.style + "}";
/*     */   }
/*     */ 
/*     */   public FontKey clone() {
/* 108 */     FontKey clone = null;
/*     */     try {
/* 110 */       clone = (FontKey)super.clone();
/*     */     } catch (CloneNotSupportedException e) {
/* 112 */       throw new RuntimeException(e);
/*     */     }
/* 114 */     return clone;
/*     */   }
/*     */ }

/* Location:           X:\repository\com\yss\sofa\cml\cml-api\1.1.0\cml-api-1.1.0.jar
 * Qualified Name:     com.yss.sofa.cml.text.FontKey
 * JD-Core Version:    0.6.0
 */